In computer related technologies, certain applications such as reports are generated to obtain information on various aspects. For example, in a social networking environment reports may be generated for obtaining data associated with a sliding window. The data can include information such as the list of users who visited a particular website in the last seven days, number of comments made by users in the last hour, etc. As time progresses, the sliding window moves and new data is generated. Obtaining results from the database every time the sliding window moves or every time the report is generated consumes significant computing resources and causes a significant delay.
Some caching techniques have been suggested to cache frequently retrieved sliding window data. The prior caching techniques are not efficient in terms of managing the cache with respect to sliding window data. For example, the prior caching techniques are not efficient at least in (a) determining the buffer sizes to be allotted to cache the data, (b) determining how much old data has to be purged from the cache as new data is added when the sliding window moves, (c) minimizing the number of database calls to obtain the data for updating the cache, etc.
The prior caching techniques either made use of a large cache to hold higher resolution sliding window data, such as 168 data elements for a week at hourly granularity level, or a smaller cache to hold data at lower resolution, such as 7 data elements for a week at daily granularity level, or even smaller cache that holds data such as 24 data elements for a day at hourly granularity level. That is, the prior caching techniques emphasized on cache size or granularity level or storage unit access frequency. The prior caching techniques lacked ability to store data at higher granularity while consuming less memory or accessed the storage unit more frequently.